package com.only4play.practice.common.exception;

import com.only4play.codegen.support.constants.BaseEnum;
import lombok.Data;

@Data
public class BizException extends RuntimeException {

    private int code;
    private String msg;

    public BizException(Integer code, String message) {
        super(message);
        this.code = code;
        this.msg = message;
    }
    public BizException(BaseEnum bizCodeEnum){
        super(bizCodeEnum.getName());
        this.code = bizCodeEnum.getCode();
        this.msg = bizCodeEnum.getName();
    }


}
